package com.scanx.thread.directory;

import com.scanx.conf.CommonConf;
import com.scanx.thread.ThreadPoolUtil;

import java.io.File;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 路径控制器
 *
 * @author alpha.
 * @className PathCtrl
 * @date 2024/2/6 15:26
 */
public class PathScanner {

    public static void scan() {
        String startPath = CommonConf.START_PATH;
        ThreadPoolExecutor executor = ThreadPoolUtil.newThreadPool(
                8,
                8,
                120,
                TimeUnit.MINUTES,
                "文件路径扫描线程");
        executor.execute(new PathScanThread(new File(startPath), executor));
    }

}
